﻿function loadCategory($scope)
{
    $scope.categories = categoryDatas;
    $scope.categories.forEach(function (item) {
        if ($scope.category.id.indexOf(item.Id) == 0) {
            $scope.category.SF = item;
        }
    });

    if ($scope.category.SF != undefined) {
        $scope.category.SF.Children.forEach(function (item) {
            if ($scope.category.id.indexOf(item.Id) == 0) {
                $scope.category.City = item;
            }
        });

    }
    if ($scope.category.City != undefined) {
        $scope.category.City.Children.forEach(function (item) {
            if ($scope.category.id.indexOf(item.Id) == 0) {
                $scope.category.QX = item;
            }
        });
    }
    if ($scope.category.QX != undefined) {
        $scope.category.QX.Children.forEach(function (item) {
            if ($scope.category.id.indexOf(item.Id) == 0) {
                $scope.category.Four = item;
            }
        });

    }
    if ($scope.category.Four != undefined) {
        $scope.category.Four.Children.forEach(function (item) {
            if ($scope.category.id.indexOf(item.Id) == 0) {
                $scope.category.Five = item;
            }
        });
    }
}